package com.neo.rabbit.object;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.neo.model.User;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class ObjectSender
{
    @Autowired
    private AmqpTemplate rabbitTemplate;
    
    public void send(User user)
    {
        log.info("Sender object: " + user.toString());
        this.rabbitTemplate.convertAndSend("object", user);
    }
}